package net.huashitong.synthetical.newSupervision.service;

import com.sirdc.modules.core.dao.BaseDao;
import com.sirdc.modules.sys.base.StringPKService;
import com.sirdc.modules.sys.service.SysTableService;
import net.huashitong.synthetical.newSupervision.dao.TaskCopeToDao;
import net.huashitong.synthetical.newSupervision.dao.TaskScoreDao;
import net.huashitong.synthetical.newSupervision.entity.TaskCopeTo;
import net.huashitong.synthetical.newSupervision.entity.TaskNew;
import net.huashitong.synthetical.newSupervision.entity.TaskScore;
import net.huashitong.synthetical.newSupervision.filter.TaskCopeToFilter;
import net.huashitong.synthetical.newSupervision.filter.TaskNewFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.xml.ws.Action;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: ling
 * Date: 2019/8/5
 * Time: 10:10
 * To change this template use File | Settings | File Templates.
 * Description:
 */
@Service
public class TaskCopeToService extends StringPKService<TaskCopeTo> {

    @Autowired
    private TaskCopeToDao taskCopeToDao;
    @Autowired
    private SysTableService tableService;

    @Override
    protected BaseDao<TaskCopeTo, String> getDao() {
        return this.taskCopeToDao;
    }

    @Override
    protected void beforeSave(TaskCopeTo obj) {
        obj.setSysId(tableService.updateMaxSysId("t_task_cope_to", null));

    }

    public List<TaskNew> queryFilter(TaskNewFilter filter) {
        return taskCopeToDao.queryFilter(filter);
    }

    public List<TaskCopeTo> getByTaskId(String taskId) {
        return taskCopeToDao.getByTaskId(taskId);
    }
}
